package day04;

public class 标准练习1 {
    public static void main(String[] args) {
        /*
        //命令解析程序 switch...case...
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能:1.取款 2.存款 3.查询余额  其他数字.退卡");
        int command = scan.nextInt();

        switch(command){
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("查询余额操作...");
                break;
            case 4:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
         */


            //Guessing猜数字while版
            //随机生成一个数，由用户来猜，猜不对则反复猜，并给出大小提示，猜对的则结束，用while来实现
            /*
              Scanner scan = new Scanner（System.in);


            Scanner scan = new Scanner(System.in);
            int num = (int)(Math.random())*10000+1;
                System.out.println("猜吧！");
                int guess = scan.nextInt();
                while(guess!=num){
                    if(guess>num){
                        System.out.println("太大了");
                    }else{
                        System.out.println("太小了");
                    }
                    System.out.println("猜吧！");
                    guess = scan.nextInt();
                }
                System.out.println("恭喜你猜对了!");

             */


/*
                //Guessing猜数字do...while版：
                //随机生成一个数，由用户来猜，猜不对则反复猜，并给出大小提示，猜对的则结束，用do...while来实现
                Scanner scan = new Scanner(System.in);
                int num = (int)(Math.random()*1000+1);
                int guess;
                do{
                    System.out.println("猜吧！");
                    guess = scan.nextInt();
                    if(guess>num){
                        System.out.println("太大了");
                    }else if(guess<num){
                        System.out.println("太小了");
                    }else{
                        System.out.println("恭喜你猜对了");
                    }
                }while(guess!=num);

 */



                //for循环：输出5次"行动是成功的阶梯"、输出9的乘法表(1到9、1/3/5/7/9、9到1)
                for(int times=0 ; times<5 ; times++){
                    System.out.println("行动是成功的阶梯");
                }
                System.out.println("继续执行...");

                for(int num = 1;num<=9;num++){
                    System.out.println(num+"*9="+num*9);
                }
                for(int num = 1;num<=9;num+=2){
                    System.out.println(num+"*9="+num*9);
                }
                for(int num = 9;num>=1;num--){
                    System.out.println(num+"*9="+num*9);
                }
        }
}